45c842bc55408a5109c5795d86195bfca792a953,xenon-common/src/test/java/com/vmware/xenon/services/common/TestMigrationTaskService.java,TestMigrationTaskService,failOnSourceNodeFailureBeforeIssuingQuery,#,891
Before Change
TestContext ctx = testCreate(1);
String[] out = new String[1];
Operation op = Operation.createPost(this.destinationFactoryUri)
.setBody(migrationState)
.setCompletion((o, e) -> {
if (e != null) {
this.host.log("Post service error: %s", Utils.toString(e));
ctx.failIteration(e);
return;
}
out[0] = o.getBody(State.class).documentSelfLink;
ctx.completeIteration();
});
getDestinationHost().send(op);
testWait(ctx);
State waitForServiceCompletion = waitForServiceCompletion(out[0], getDestinationHost());
After Change
migrationState.sourceNodeGroupReference = FAKE_URI;
migrationState.destinationNodeGroupReference = UriUtils.extendUri(getDestinationHost().getPublicUri(), ServiceUriPaths.DEFAULT_NODE_GROUP);
Operation op = Operation.createPost(this.destinationFactoryUri).setBody(migrationState);
State state = getDestinationHost().getTestRequestSender().sendAndWait(op, State.class);
State waitForServiceCompletion = waitForServiceCompletion(state.documentSelfLink, getDestinationHost());
assertEquals(TaskStage.FAILED, waitForServiceCompletion.taskInfo.stage);
}